<template>
  <div>
    <div>Selected: {{ selected_deptno }}</div>

    <select v-model="selected_deptno">
      <option disabled value="0">Please select one</option>
      <option
        v-for="dept in depts"
        :key="'dept' + dept.deptno"
        :value="dept.deptno"
      >
        {{ dept.dname }}
      </option>
    </select>
  </div>
</template>
<script setup>
import { computed, ref } from "vue";
const depts = ref([
  {
    deptno: 10,
    dname: "研发部",
  },
  {
    deptno: 20,
    dname: "研发部20",
  },
  {
    deptno: 30,
    dname: "研发部30",
  },
]);
const selected_deptno = ref(0);
</script>
